Automatically Identifying Dead Fields in Test Code by Resolving Method Call and Field Dependency

نویسندگان

  • Abdus Satter
  • Nadia Nahar
  • Kazi Sakib
چکیده

Dead fields are the unused setup fields in the test code which reduce the comprehensibility and maintainability of a software system. A test class contains dead fields when developers initialize setup fields without analyzing the usage of fields properly. Manually identifying dead fields to remove from the code is a time consuming and error-prone task. In this paper, a technique named Dead Field Detector (DFD) has been proposed to detect dead fields automatically. The technique constructs Call Graph (CG) and Data Dependence Graph (DDG) from test code to find method invocation and field dependency relationships, respectively. It identifies the fields initialized in the setup method and its invoked methods from CG. It finds setup fields by collecting the initialized fields and their dependent fields from DG. To determine the usage of the setup fields, it checks the bodies of the test methods and their invoked methods obtained from CG. All the unused setup fields are separated from the used fields and considered as dead fields. In order to evaluate DFD, an open source project named eGit was used. The result analysis shows that DFD has identified 14.03% more setup fields and 60.98% more dead fields than an existing technique named TestHound for eGit.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Static Code Search Technique to Identify Dead Fields by Analyzing Usage of Setup Fields and Field Dependency in Test Code

Dead field is one of the most common test smells found in the test code which is responsible for degrading performance and creating misapprehension about the code. The reason of its occurrences is that in most of the cases, developers initialize setup fields without considering the usage of those fields in the test methods. In this paper, an automatic dead field identification technique is prop...

متن کامل

Exposure to electromagnetic fields at two call centers in Turkey, 2015

Background: This study aims to evaluate the negative health impacts of exposure to electromagnetic field and to prepare a risk map of two selected call centers. Materials and Methods: Two call centers whose electromagnetic field values were measured by calibrated low high and point frequency measurement device. The measurements were performed by following the EN 50492 Standards. 178 employees ...

متن کامل

A Static Calculus of Dependencies for the -cube

Dependency analysis aims at identifying how different parts of a program depend on each others. It is the kernel of many issues in program analysis such as dead-code, binding time, strictness, program slicing etc. We address the problem of dependency analysis in the context of typed -calculus. We consider all systems of the -cube and extend them conservatively by the addition of new typing rule...

متن کامل

identifying learnings and results of teachers' experiences in the field of art application in instruction and teaching

This article is the result of examining the experiences of teachers in the field of using art in instruction and teaching non-art subjects. This research is a qualitative type of research, therefore, 57 teachers of Alborz and Tehran provinces were selected by the purposeful sampling method and 22 cases were collected. The tool for collecting data was interview, as well as a written form of an o...

متن کامل

Dose Calculations for Lung Inhomogeneity in High-Energy Photon Beams and Small Beamlets: A Comparison between XiO and TiGRT Treatment Planning Systems and MCNPX Monte Carlo Code

Introduction Radiotherapy with small fields is used widely in newly developed techniques. Additionally, dose calculation accuracy of treatment planning systems in small fields plays a crucial role in treatment outcome. In the present study, dose calculation accuracy of two commercial treatment planning systems was evaluated against Monte Carlo method. Materials and Methods Siemens Once or linea...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2017